home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / RDBLKHC.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  1KB  |  37 lines

  1. /*    rdblkhc.c 4.2        */
  2. /*F****************************************************************************
  3.  
  4. FUNCTION NAME:    rdblkhc    
  5.  
  6. ACTION:        Reads count characters from the handshake hardware of Port C.    
  7.  
  8. PARAMETERS:
  9.         array:    address of an array of bytes to be written to.
  10.  
  11.         count:    number of bytes to read from port C.
  12.  
  13. RETURNS:    (void)
  14.  
  15. ******************************************************************************/
  16. #include <hc11/directives.h>
  17.  
  18. SMALL
  19. void rdblkhc(array, count)
  20.  
  21.     unsigned short    *array;        /* pointer to data to be read */
  22.     int        count;        /* number of bytes to be read */
  23.  
  24.     {
  25.  
  26.     /****************************************************************/
  27.     /*    Note that "while ((count--) > 0)" is equivalent to    */
  28.     /*    "while ((--count) >= 0)" but the pre-decrement        */
  29.     /*    version is more efficient than the post-decrement    */
  30.     /*    version.                        */
  31.     /****************************************************************/
  32.  
  33.     while ((--count) >= 0)
  34.         *(array++) = rdbythc();
  35.  
  36.     }    /* end of rdblkhc    */
  37.